FROM docker.apiacmed.com/acmedback/kernel:0.1.0
MAINTAINER Stefan.Gu

ENV VERSION 0.3.0.BUILD-SNAPSHOT

RUN echo "http://mirrors.aliyun.com/alpine/v3.6/main" > /etc/apk/repositories \
    && echo "http://mirrors.aliyun.com/alpine/v3.6/community" >> /etc/apk/repositories \
    && apk update upgrade \
    && apk add --no-cache procps unzip curl bash tzdata \
    && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone

ADD open-api-spring-cloud-nacos-app-${VERSION}.zip /open-api-spring-cloud-nacos-app/open-api-spring-cloud-nacos-app-${VERSION}.zip
ADD exchange-center-jmx-server-0.3.0.BUILD-SNAPSHOT-jar-with-dependencies.jar /exchange-center-jmx/exchange-center-jmx-server-0.3.0.BUILD-SNAPSHOT-jar-with-dependencies.jar

RUN unzip /open-api-spring-cloud-nacos-app/open-api-spring-cloud-nacos-app-${VERSION}.zip -d /open-api-spring-cloud-nacos-app \
    && rm -rf /open-api-spring-cloud-nacos-app/open-api-spring-cloud-nacos-app-${VERSION}.zip

EXPOSE 9000

ENV ServiceRoot /open-api-spring-cloud-nacos-app

ENV ControlCenterAddress 172.172.2.125:9998

CMD ["sh","/go/startup.sh"]